home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-11
/
vs_804.zip
/
MAINTSRC.EXE
/
E_DICTHD.PRG
< prev
next >
Wrap
Text File
|
1991-11-25
|
6KB
|
241 lines
* Filename.......: E_DICTHD.PRG
*
* Author.........: Vernon E. Six, Jr.
*
* Last Update....: Mon 11/25/91 16:37:16
*
* Created using..: VSG - Vern Six's Get System v1.00.53a
*
* Notice.........: CopyRight (c) 1991 by Vernon E. Six, Jr.
* All Rights Reserved World Wide!
#include "INKEY.CH"
#include "SETCURS.CH"
#include "_DICTHDR.CH"
FUNCTION E_DICTHDR(pl_Update,pc_Mode)
*══════════════════════════════════════════════════════════*
* Edit the current database header record *
*══════════════════════════════════════════════════════════*
LOCAL getlist := {}
LOCAL GetObj
LOCAL l_EatKeys := .F.
LOCAL a_Say := {}
LOCAL a_Get := {}
LOCAL n_Cntr
LOCAL c_OldHelp
LOCAL n_Correct := 1
*══ Make an assumption ═══════════════════════════════════*
pc_Mode = IF(pc_Mode=NIL,"EDIT",UPPER(pc_Mode))
*═════════════════════════════════════════════════════════*
_DICTHDR->( VS_SetOrder("1") )
AADD( a_Get, IF(pl_Update, _DICTHDR->DBF_NAME , _DEF__DICTHDR_DBF_NAME ))
AADD( a_Get, IF(pl_Update, _DICTHDR->DESC , _DEF__DICTHDR_DESC ))
AADD( a_Get, IF(pl_Update, _DICTHDR->CREATE , _DEF__DICTHDR_CREATE ))
AADD( a_Get, IF(pl_Update, _DICTHDR->PATH , _DEF__DICTHDR_PATH ))
VS_GRABSCR()
VS_PALETTE(4)
VS_Text(2,"",PADC("Working...",40),"")
DispBegin()
VS_EndText()
IF pc_Mode = "DISPLAY"
VS_WIND(05,05,15,68," DataBase Header Information "," Press Any Key To Continue ")
ELSE
VS_WIND(05,05,15,68," DataBase Header Information "," Press <F1> For Help ")
ENDIF
@ 07,07 SAY "DataBase Name:"
@ 08,09 SAY "Description:"
@ 10,07 SAY "Recreate this database, if missing?"
@ 12,07 SAY "Default Path..."
SETCOLOR(VS_WindUns())
VS_WndColr()
*══════════════════════════════════════════════════════════*
IF pl_Update
@ 07,22 SAY a_Get[001] ;
PICTURE _PIC__DICTHDR_DBF_NAME ;
COLOR VS_WindUns()
ELSE
GetObj := GetNew( 07,22, ;
{|x| IF(x==NIL,a_Get[001], a_Get[001]:=x)},;
"a_Get[001]", ;
_PIC__DICTHDR_DBF_NAME )
GetObj:cargo := {"_DICTHDR","DBF_NAME"}
GetObj:postBlock := { || VS_EatKeys(@l_EatKeys) }
AADD( getlist, GetObj )
GetObj:Display()
ENDIF
*══════════════════════════════════════════════════════════*
GetObj := GetNew( 08,22, ;
{|x| IF(x==NIL,a_Get[002], a_Get[002]:=x)},;
"a_Get[002]", ;
_PIC__DICTHDR_DESC )
GetObj:cargo := {"_DICTHDR","DESC"}
GetObj:postBlock := { || VS_EatKeys(@l_EatKeys) }
AADD( getlist, GetObj )
GetObj:Display()
*══════════════════════════════════════════════════════════*
GetObj := GetNew( 10,43, ;
{|x| IF(x==NIL,a_Get[003], a_Get[003]:=x)},;
"a_Get[003]", ;
_PIC__DICTHDR_CREATE )
GetObj:cargo := {"_DICTHDR","CREATE"}
GetObj:postBlock := { || VS_EatKeys(@l_EatKeys) }
AADD( getlist, GetObj )
GetObj:Display()
*══════════════════════════════════════════════════════════*
GetObj := GetNew( 13,07, ;
{|x| IF(x==NIL,a_Get[004], a_Get[004]:=x)},;
"a_Get[004]", ;
_PIC__DICTHDR_PATH )
GetObj:cargo := {"_DICTHDR","PATH"}
GetObj:postBlock := { || VS_EatKeys(@l_EatKeys) }
AADD( getlist, GetObj )
GetObj:Display()
*══════════════════════════════════════════════════════════*
SETCURSOR(SC_NORMAL)
DispEnd()
*══════════════════════════════════════════════════════════*
* Do all the pre-validations *
*══════════════════════════════════════════════════════════*
IF pl_Update .OR. pc_Mode="DISPLAY"
ENDIF
IF pc_Mode = "DISPLAY"
CLEAR GETS
SETCURSOR(SC_NONE)
VS_INKEY(0)
ELSE
DO WHILE .T.
l_EatKeys := .F.
c_OldHelp = VS_HelpPrg("E_DICTHDR ")
ReadModal(getlist)
VS_HelpPrg(c_OldHelp)
CLEAR TYPEAHEAD
IF LASTKEY() = K_ESC
EXIT
ENDIF
n_Correct = VS_Correct()
DO CASE
CASE n_Correct = 3
VS_PutScr()
RETURN(NIL)
CASE n_Correct = 2
LOOP
ENDCASE
EXIT
ENDDO
ENDIF
VS_PutScr()
CLEAR TYPEAHEAD
IF LASTKEY() = K_ESC .OR. pc_Mode = "DISPLAY"
RETURN(NIL)
ENDIF
BEGIN SEQUENCE
IF .NOT. pl_Update
IF .NOT. _DICTHDR->(VS_AddRec())
BREAK
ELSE
REPLACE _DICTHDR->DBF_NAME WITH _DEF__DICTHDR_DBF_NAME
REPLACE _DICTHDR->DESC WITH _DEF__DICTHDR_DESC
REPLACE _DICTHDR->CREATE WITH _DEF__DICTHDR_CREATE
REPLACE _DICTHDR->PATH WITH _DEF__DICTHDR_PATH
ENDIF
ELSE
IF .NOT. _DICTHDR->(VS_RLOCK())
BREAK
ENDIF
ENDIF
REPLACE _DICTHDR->DBF_NAME WITH a_Get[001]
REPLACE _DICTHDR->DESC WITH a_Get[002]
REPLACE _DICTHDR->CREATE WITH a_Get[003]
REPLACE _DICTHDR->PATH WITH a_Get[004]
_DICTHDR->( dbUnlock() )
END SEQUENCE
RETURN(NIL)
*══ EOF: E_DICTHDR() ═════════════════════════════════════════════════════════*